package a10_动态规划;

import java.util.Arrays;

/**
 * <p>
 * a42_最长连续递增序列复习2
 * </p>
 *
 * @author flyduck
 * @since 2025/2/28
 */
public class a42_最长连续递增序列复习2 {
    public int findLengthOfLCIS(int[] nums) {
        int result = 1;

        int[] dp = new int[nums.length];
        Arrays.fill(dp, 1);

        for (int i = 1; i < nums.length; i++) {
            if(nums[i] > nums[i-1]){
                dp[i] = dp[i-1] + 1;
            }
            result = Math.max(result, dp[i]);
        }

        return result;
    }
}
